package com.Serializable;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @description: 测试类
 * @author: 刘建楼
 * @create: 2021-04-10
 **/
public class WriteObject {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("object.txt"));
        Person person = new Person("孙悟空", 500);
        oos.writeObject(person);
    }
}
